Skip to content

fix(240): distinct fractional-overlay palettes and legend visibility sync#388

Open
igoroctaviano wants to merge 2 commits into
masterfrom
feat/240-frac-seg-colors-overlay-toggle
Open

fix(240): distinct fractional-overlay palettes and legend visibility sync#388
igoroctaviano wants to merge 2 commits into
masterfrom
feat/240-frac-seg-colors-overlay-toggle

Conversation

@igoroctaviano

Copy link
Copy Markdown
Collaborator

Summary

Addresses the Slim side of dicom-microscopy-viewer#240 (improve LUT color selection for fractional segmentations + toggle overlays without the side panel).

  • Replace the look-alike colormap cycling (VIRIDIS → MAGMA → INFERNO → HOT → …) in distinctOverlayColormaps.ts with dmv.color.createDistinctColormap(index), giving each fractional segment and parametric map a perceptually distinct single-hue palette that is easy to distinguish and to match against the legend. DICOM RecommendedDisplayCIELabValue is still honored.
  • Subscribe to the new dicom-microscopy-viewer visibility events (SEGMENT_VISIBILITY_CHANGED / PARAMETER_MAPPING_VISIBILITY_CHANGED) so toggling an overlay from the in-viewport legend keeps the right-panel switches in sync (state-only mirror, no toggle loop).
  • Add the createDistinctColormap type to the local dicom-microscopy-viewer type declarations.

Changes

  • src/utils/distinctOverlayColormaps.ts: use createDistinctColormap for fractional segments and parametric maps.
  • src/components/SlideViewer.tsx: listen for the new visibility events and mirror them into visibleSegmentUIDs / visibleMappingUIDs.
  • types/dicom-microscopy-viewer/index.d.ts: declare color.createDistinctColormap.

Depends on

ImagingDataCommons/dicom-microscopy-viewer#242 — Slim must consume a build of that branch (it currently resolves the published dicom-microscopy-viewer@0.48.21); createDistinctColormap and the events come from there.

Test plan

  • With the companion DMV build linked, load a study with multiple fractional segmentations → distinct, legend-matchable colors.
  • Toggle an overlay from the viewport legend → the matching right-panel switch updates, and vice versa.

…sync

Use dmv.color.createDistinctColormap() to give each fractional segment and
parametric map a perceptually distinct single-hue palette instead of cycling
look-alike multi-hue color maps, so overlays are easy to distinguish and to
match against the legend.

Subscribe to the new dicom-microscopy-viewer visibility events so toggling an
overlay from the in-viewport legend keeps the right-panel switches in sync.

Refs ImagingDataCommons/dicom-microscopy-viewer#240
@deepsource-io

deepsource-io Bot commented Jun 4, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 23997c9...a3f2c15 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Jun 4, 2026 8:05p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant